package pers.cfeng.common;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Cfeng
 * 错误信息状态码
 */

@Getter
@AllArgsConstructor
public enum  ErrorCode implements CommonException {

    //common
    CACHE_FULL("DB001","Cache is full"),
    FILE_EXISTS("DB002", "File already exists"),
    FILE_CANNOT_READ_OR_WRITE("DB003", "File can't read or write"),

    //dm 数据管理模块
    BAD_LOG_FILE("DB004", "bad log file"),
    MEM_TOO_SMALL("DB005", "Memory too small"),
    DATA_TOO_LARGE("DB006", "data too large"),
    DATABASE_BUSY("DB007", "database is busy now"),

    //tm 事务管理模块
    BAD_TID_FILE("DB008", "bad tid file"),

    //vm 并发控制模块
    DEAD_LOCK("DB009", "find deadlock"),
    CONCURRENT_UPDATE("DB010", "concurrent update"),
    NULL_ENTRY("DB011", "null entry"),

    //tbm 表管理整体
    INVALID_FIELD("DB012", "invalid field"),
    FIELD_NOT_FOUND("DB013", "field not found"),
    FIELD_NOT_INDEXED("DB014","field not indexed"),
    INVALID_LOGIC_OPERATION("DB015","invalid logic operation"),
    INVALID_VALUES("DB016","invalid values"),
    DUPLICATED_TABLE("DB017","duplicated table"),
    TABLE_NOT_FOUND("DB018", "table not found"),

    //parser 解析器
    INVALID_COMMAND("DB019", "invalid command"),
    TABLE_NO_INDEX("DB020", "table has no index"),

    //internet
    INVALID_PKG_DATA("DB021", "invalid package data"),

    //launcher
    INVALID_MEM("DB022", "invalid memory"),

    //server
    NESTED_TRANSACTION("DB023", "nested transaction not support"),
    NO_TRANSACTION("DB024", "not in transaction"),
    FILE_NOT_EXIST("DB025", "file not exists"),
    ;
    private final String code;
    private final String message;
}
